<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Article_mdl extends MY_Model {

    public function __construct() {
        parent::__construct();
        $this->table = 'article';
    }

    public function select(){
        return $this->db->get($this->table)->result_array();
    }
 
    public function get_one(){
        return $this->db->get($this->table)->row_array();
    }

    //统计
    public function get_count(){
        return $this->db->count_all_results($this->table);
    }
    //添加
    public function create($data){
        $data['end_time'] = $data['create_time'] = time();
        return $this->db->insert($this->table,$data);
    }
    //修改
    public function update($data){
        return $this->db->update($this->table,$data);
    }
    
    //删除
    public function delete(){
        return $this->db->delete($this->table);
    }
}

/* End of file Article_mdl.php */
/* Location: ./application/models/Article_mdl.php */